//
//  ZHHomeTableViewCell.m
//  Doctor
//
//  Created by liuzhishan on 15/12/15.
//  Copyright © 2015年 shanshan. All rights reserved.
//

#import "ZHHomeTableViewCell.h"
#import "ZHHospitalModel.h"

#define LABLEHEIGHT  50
@interface ZHHomeTableViewCell ()

@property (nonatomic,retain) UIImageView *bgImageView;

@property (nonatomic,retain) UILabel *lableName;
@property (nonatomic,retain) UILabel *lableOwner;
@property (nonatomic,retain) UILabel *lableTel;
@property (nonatomic,retain) UILabel *lableAddress;


@end

@implementation ZHHomeTableViewCell

 -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        [self addMyChildViews];
        
        
    }
    
  
    
    return  self;
    
}

-(void)addMyChildViews
{
    self.backgroundColor = [UIColor clearColor];
    self.contentView.backgroundColor = [UIColor clearColor
                                        ];
    
    self.bgImageView = [[UIImageView alloc]init];
    self.bgImageView.image = [UIImage imageNamed:@"table-2"];
    [self.bgImageView setMyFramewithX:0 andY:22 andWidth:635 andHeight:111];
    [self.contentView addSubview:self.bgImageView];
    
    self.lableName = [[UILabel alloc]init];
    [self.lableName setMyFramewithX:90 andY:68 andWidth:160 andHeight:LABLEHEIGHT];
     self.lableName.text = @"门诊名称：";
    self.lableName.font = [UIFont systemFontOfSize:14*WIDPro - 2];
    self.lableName.textColor = [UIColor whiteColor];
    self.lableName.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.lableName];
    
    self.lableOwner = [[UILabel alloc]init];
    [self.lableOwner setMyFramewithX:250 andY:68 andWidth:80 andHeight:LABLEHEIGHT];
    self.lableOwner.text = @"负责人：";
    self.lableOwner.font = [UIFont systemFontOfSize:14*WIDPro - 2];
    self.lableOwner.textAlignment = NSTextAlignmentCenter;
    self.lableOwner.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.lableOwner];
    
    
    
    self.lableTel = [[UILabel alloc]init];
    [self.lableTel setMyFramewithX:340 andY:68 andWidth:150 andHeight:LABLEHEIGHT];
    self.lableTel.text = @"联系电话：";
    self.lableTel.textColor = [UIColor whiteColor];
     self.lableTel.font = [UIFont systemFontOfSize:14*WIDPro - 2];
    self.lableTel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.lableTel];
    
    self.lableAddress = [[UILabel alloc]init];
    [self.lableAddress setMyFramewithX:480 andY:68 andWidth:130 andHeight:LABLEHEIGHT];
    self.lableAddress.text = @"地址：";
      self.lableAddress.textColor = [UIColor whiteColor];
    self.lableAddress.font = [UIFont systemFontOfSize:14*WIDPro - 2];
    self.lableAddress.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.lableAddress];
    
    
    
    
}

-(void)setModel:(ZHHospitalModel *)model
{
       _model = model;


      self.lableName.text = [NSString stringWithFormat:@"%@%@",@"门诊名称：", model.shopName];
    
      self.lableOwner.text = [NSString stringWithFormat:@"%@%@",@"负责人：",model.shopContacts];
    
      self.lableTel.text = [NSString stringWithFormat:@"%@%@",@"联系电话：",model.shopTelephone];
    
      self.lableAddress.text = [NSString stringWithFormat:@"%@%@",@"地址：",model.shopAddress];
    
    
    
}

@end
